// Upper and lower case a string without built in functions.
// By DreamVB 00:16 14/10/2016

#include <iostream>

using namespace std;
using std::cout;
using std::endl;

void UCase(char *s){
	int i = 0;
	while (s[i] != NULL){
		if ((s[i] >= 'a') && (s[i] <= 'z')){
			s[i] = (int)s[i] - 32;
		}
		i++;
	}
}

void LCase(char *s){
	int i = 0;
	while (s[i] != NULL){
		if ((s[i] >= 'A') && (s[i] <= 'Z')){
			s[i] = (int)s[i] + 32;
		}
		i++;
	}
}

int main(int argc, char *argv[]){
	char s0[80];
	char s1[80];

	cout << "Enter a string : ";
	//Get input from user.
	cin >> s0;
	//Turn uppercase
	UCase(s0);
	cout << "The string in uppercase is : " << s0 << endl;
	//Turn lowercase
	LCase(s0);
	cout << "The string in lower case is : " << s0 << endl;

	system("pause");
	return 0;
}